/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ericsson.nfc.signing.certificate;

import com.ericsson.nfc.signing.algorithm.DefaultVerifierFactory;
import com.ericsson.nfc.signing.algorithm.PublicKey;
import com.ericsson.nfc.signing.algorithm.VerifierFactory;

/**
 *
 * @author emarkki
 */
public abstract class CertificateChain {

    public boolean validateChain(Certificate[] trustedCerts) throws InvalidCertificateChain {
        return validateChain(trustedCerts, new DefaultVerifierFactory());
    }
    
    public abstract boolean validateChain(Certificate[] trustedCerts, VerifierFactory verifierFactory) throws InvalidCertificateChain;
    
    public abstract String getValidationMessage();

    public abstract Certificate[] getCertificates();
    public abstract Certificate getUserCertificate();
    public abstract Certificate getRootCertificate();
    
    public abstract CertificateChain concat(CertificateChain chain);

    public abstract PublicKey getPublicKey(Certificate certificate);
}
